Skip to content

Conversation

@shaykeren
Copy link

This PR fixes the IllegalStateException occurring in the GET /owners/{ownerId}/pets endpoint by:

  1. Replacing toMap collector with groupingBy to properly handle multiple pets per owner
  2. Using ArrayList for mutable list structures
  3. Adding proper null handling
  4. Fixing the stream collection logic for multiple pets

The issue was causing failures when owners had multiple pets (e.g., owner ID 6 with pets 7 and 8).

Fixes the IllegalStateException by properly handling the case where an owner has multiple pets in the stream collection operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants